﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="BiaoKaPX.aspx.cs" Inherits="Web.Pages.QuShui.DiXiaS.ChaoBiaoGL.BiaoKaPX" Theme="Default" %>

<%@ Register Assembly="DevExpress.Web.v15.2, Version=15.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="dx" %>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>表卡排序</title>
    <script src="../../../../JS/jquery.js"></script>
    <script src="../../../../JS/AddEditCancel.js"></script>
    <script type="text/javascript">
        function tab2validate(e)
        {
            if (txtShuiBiaoH1.GetText() == "")
            {
                alert("请填写要调动的表号");
                e.processOnServer = false;
                return;
            }
            if (cmbCeHao2.GetText() == cmbCeHao3.GetText())
            {
                alert("要调动的册号与原册号不能一致");
                e.processOnServer = false;
                return;
            }
            var exists = false;
            for (var i = 0; i < gvList2.GetVisibleRowsOnPage() ; i++) {
                if (gvList2.GetRowKey(i) == txtShuiBiaoH1.GetText()) {
                    exists = true;
                    break;
                }
            }
            if (exists==false)
            {
                alert("请输入正确的水表号");
                e.processOnServer = false;
                return;
            }
            e.processOnServer = true;
        }
    </script>
     <style type="text/css">
        .headHide {
            display: none;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <div class="tabletitle1" align="center">
            表卡排序
        </div>
       <%-- <div style="display: none;">
            <dx:ASPxHiddenField ID="hdCollection" ClientInstanceName="hdCollection" runat="server"></dx:ASPxHiddenField>
            <dx:ASPxCallback ID="ASPxCallback1" ClientInstanceName="ASPxCallback1" runat="server" OnCallback="ASPxCallback1_Callback" ClientSideEvents-CallbackComplete="function(s,e){ASPxCallback1Complete(e.result);}"></dx:ASPxCallback>
        </div>--%>
        <asp:UpdatePanel runat="server" ID="updatePanel1">
            <ContentTemplate>
                <dx:ASPxPageControl ID="ASPxPageControl1" runat="server" ActiveTabIndex="0" Width="100%">
                    <TabPages>
                        <dx:TabPage Text="同册排序">
                            <ContentCollection>
                                <dx:ContentControl runat="server" SupportsDisabledAttribute="True">
                                    <div style="width: 99.8%;">
                                        <div style="width: 45%; margin: 0 auto; margin-top: 30px;">
                                            <table>
                                                <tr>
                                                    <td>册号：
                                                    </td>
                                                    <td>
                                                        <dx:ASPxComboBox ID="cmbCeHao" runat="server" ValueType="System.String" Width="150px" OnSelectedIndexChanged="cmbCeHao_SelectedIndexChanged" AutoPostBack="true">
                                                        </dx:ASPxComboBox>
                                                    </td>
                                                </tr>
                                            </table>
                                            <fieldset style="border: 1px solid  cornflowerblue">
                                                <div class="left" style="border: 1px solid #666; float: left; width: 72%; overflow: auto">
                                                    <dx:ASPxGridView ID="gvList" ClientInstanceName="gvList" runat="server" AutoGenerateColumns="False" KeyFieldName="ID" Theme="Aqua1" Width="100%"
                                                       OnFocusedRowChanged="gv_FocusedRowChanged"  EnableCallBacks="false" OnCustomCallback="gvList_CustomCallback">
                                                        <Columns>
                                                            <dx:GridViewDataTextColumn FieldName="S_SHUIBIAOBH" Caption="" Width="15%" HeaderStyle-CssClass="headHide">
                                                            </dx:GridViewDataTextColumn>
                                                        </Columns>
                                                        <SettingsBehavior AllowFocusedRow="True" ColumnResizeMode="Control"  ProcessFocusedRowChangedOnServer="True" />
                                                        <Settings VerticalScrollableHeight="400" VerticalScrollBarMode="Auto" />
                                                    </dx:ASPxGridView>
                                                </div>
                                                <div class="right" style="border: 0px solid red; height: 30%; width: 15%; margin-top: 80px; margin-left: 12px; float: left;">

                                                    <p>
                                                        <dx:ASPxButton ID="btnUp" runat="server" Text="上移" UseSubmitBehavior="false" Visible="true" OnClick="btnUp_Click">
                                                        </dx:ASPxButton>
                                                        <p>
                                                        </p>
                                                        <p>
                                                            <dx:ASPxButton ID="btnDown" runat="server" OnClick="btnDown_Click" Text="下移" UseSubmitBehavior="false" Visible="true">
                                                            </dx:ASPxButton>
                                                            <p>
                                                            </p>
                                                        </p>
                                                </div>
                                            </fieldset>
                                        </div>
                                    </div>
                                    <div style="text-align: right;">
                                        <hr />
                                        <dx:ASPxButton ID="btnSave" runat="server" Text="保存" UseSubmitBehavior="false" Visible="true" OnClick="btnSave_Click">
                                        </dx:ASPxButton>
                                        <dx:ASPxButton ID="btnCancel" runat="server" Text="放弃" UseSubmitBehavior="false" Visible="true" OnClick="btnCancel_Click">
                                        </dx:ASPxButton>
                                    </div>
                                </dx:ContentControl>
                            </ContentCollection>
                        </dx:TabPage>
                        <dx:TabPage Text="异册调表">
                            <ContentCollection>
                                <dx:ContentControl runat="server" SupportsDisabledAttribute="True">
                                   <div style="width: 99.8%;">
                                        <div style="width: 45%; margin: 0 auto; margin-top: 30px;">
                                            <table>
                                                <tr>
                                                    <td>册号：</td>
                                                    <td>
                                                        <dx:ASPxComboBox ID="cmbCeHao2" ClientInstanceName="cmbCeHao2" runat="server" ValueType="System.String" Width="100px" OnSelectedIndexChanged="cmbCeHao2_SelectedIndexChanged" AutoPostBack="true">
                                                        </dx:ASPxComboBox>
                                                    </td>
                                                    <td align="right">表号：</td>
                                                    <td>
                                                        <dx:ASPxTextBox runat="server" ID="txtShuiBiaoH1"  ClientInstanceName="txtShuiBiaoH1" Width="120PX"></dx:ASPxTextBox>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>调整到：</td>
                                                    <td>
                                                        <dx:ASPxComboBox ID="cmbCeHao3" ClientInstanceName="cmbCeHao3" runat="server" ValueType="System.String" Width="100px" AutoPostBack="false">
                                                        </dx:ASPxComboBox>
                                                    </td>
                                                   <%-- <td align="right">表号：</td>
                                                    <td>
                                                        <dx:ASPxTextBox runat="server" ID="txtShuiBiaoH2" Width="120PX" ></dx:ASPxTextBox>
                                                    </td>--%>
                                                </tr>
                                            </table>
                                            <fieldset style="border: 1px solid  cornflowerblue">
                                                <div class="left" style="border: 1px solid #666; float: left; width: 72%; overflow: auto">
                                                    <dx:ASPxGridView ID="gvList2" ClientInstanceName="gvList2" runat="server" AutoGenerateColumns="False" KeyFieldName="S_SHUIBIAOBH" Theme="Aqua1" Width="100%"
                                                       OnFocusedRowChanged="gv2_FocusedRowChanged"  EnableCallBacks="false" OnCustomCallback="gvList2_CustomCallback">
                                                        <Columns>
                                                            <dx:GridViewDataTextColumn FieldName="S_SHUIBIAOBH" Caption="" Width="15%" HeaderStyle-CssClass="headHide">
                                                            </dx:GridViewDataTextColumn>
                                                        </Columns>
                                                        <SettingsBehavior AllowFocusedRow="True" ColumnResizeMode="Control"  ProcessFocusedRowChangedOnServer="True" />
                                                        <Settings VerticalScrollableHeight="400" VerticalScrollBarMode="Auto" />
                                                    </dx:ASPxGridView>
                                                </div>
                                               
                                            </fieldset>
                                        </div>
                                    </div>
                                    <div style="text-align: right;">
                                        <hr />
                                        <dx:ASPxButton ID="btnSave2" runat="server" Text="保存" UseSubmitBehavior="false" Visible="true" OnClick="btnSave2_Click">
                                            <ClientSideEvents Click="function(s,e){tab2validate(e);}" />
                                        </dx:ASPxButton>
                                        <dx:ASPxButton ID="btnCancel2" runat="server" Text="放弃" UseSubmitBehavior="false" Visible="false" OnClick="btnCancel2_Click">
                                        </dx:ASPxButton>
                                    </div>
                                </dx:ContentControl>
                            </ContentCollection>
                        </dx:TabPage>
                    </TabPages>
                </dx:ASPxPageControl>
            </ContentTemplate>
        </asp:UpdatePanel>
    </form>
</body>
</html>
